package Model;


import Model.Dep;
import Model.DAO;
import java.util.Collection;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author sio
 */
public class Pays {
    
    Collection<Dep> lesDeps;
    Collection<Spe> lesSpe;

    public Pays(){
        lesDeps = DAO.getLesDeps();
        lesSpe = DAO.getLesSpe();
    }
    
    
    public Collection<Dep> getLesDeps(){
        return this.lesDeps;
    }
    
    public Collection<Spe> getLesSpe(){
        return this.lesSpe;
    }
    
    public Dep getLeDep(String numDep){
        for(Dep unDep : lesDeps){
            if(numDep.equals (unDep.getNum())){
                return unDep;
            }
        }
        return null;
    }
    
    public Spe getLaSpe(String idSpe){
        for(Spe uneSpe : lesSpe){
            if(idSpe.equals (uneSpe.getId())){
                return uneSpe;
            }
        }
        return null;
    }
}
